package com.listeners;

import jakarta.servlet.annotation.WebListener;
import jakarta.servlet.http.HttpSession;
import jakarta.servlet.http.HttpSessionBindingEvent;
import jakarta.servlet.http.HttpSessionBindingListener;

@WebListener
public class BindListener implements HttpSessionBindingListener {

    @Override
    public void valueBound(HttpSessionBindingEvent event) {
        HttpSession session = event.getSession();
        System.out.println("session:"+session.getId()+"attribute:"+event.getName()+"value:"+event.getValue()+"iscreat");
    }

    @Override
    public void valueUnbound(HttpSessionBindingEvent event) {
        HttpSession session = event.getSession();
        System.out.println("session:"+session.getId()+"attribute:"+event.getName()+"value:"+event.getValue()+"isremove");
    }
}
